var a = {
    id: "Scene",
    scripts: [
        { scriptName: "Transform", x: 0, y: 0, rotation: 0 },
    ],
    children: [
        {
            id: "tilemap",
            scripts: [
                { scriptName: "Transform", x: 0, y: 100, rotation: 0},
                {
                    scriptName: "TileMapRenderer", tileData: [
                        [0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                        [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
                        [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0],
                        [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0],
                        [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0],
                    ]
                }
            ],
            children: [
                {
                    id: "itemLayer",
                    scripts: [
                        { scriptName: "Transform", x: 0, y: 0, rotation: 0 },
                        {
                            scriptName: "ItemLayerBehaviour",
                            itemData: [
                                { x: 2, y: 3, cId: 1, uId: 1 },
                                { x: 11, y: 0, cId: 2, uId: 2 },
                                { x: 8, y: 6, cId: 2, uId: 3 },
                                { x: 0, y: 7, cId: 3, uId: 4 },
                            ]
                        }
                    ],
                    children: [
        
                    ]
                },
                // {
                //     id: "npcLayer",
                //     scripts: [
                //         { scriptName: "Transform", x: 0, y: 0, rotation: 0 },
                //         {
                //             scriptName: "NPCLayerBehaviour",
                //             itemData: [
                //                 { x: 3, y: 3, cId: 1, uId: 1 },
                //                 { x: 11, y: 1, cId: 2, uId: 2 },
                //                 { x: 9, y: 6, cId: 1, uId: 3 },
                //             ]
                //         }
                //     ],
                //     children: [
        
                //     ]
                // },
                {
                    id: "mainrole",
                    scripts: [
                        { scriptName: "Transform", x: 0, y: 0, rotation: 0 },
                        { scriptName: "ImageRenderer", imageName: "assets/MainRole.png" },
                        { scriptName: "MainRoleBehaviour" },
                        { scriptName: "WalkableBehaviour" },
                    ]
                },
                
                {
                    id: "staticnpc",
                    scripts: [
                        { scriptName: "Transform", x: 704, y: 448, rotation: 0 },
                        { scriptName: "ImageRenderer", imageName: "assets/npc.png" },
                    ]
                },
                {
                    id: "enemy",
                    scripts: [
                        { scriptName: "Transform", x: 640, y: 64, rotation: 0 },
                        { scriptName: "ImageRenderer", imageName: "assets/enemy.png" },
                        { scriptName: "WalkableBehaviour" },
                        {
                            scriptName: "EnemyBehaviour",
                            patrol: [{ x: 10, y: 1 }, { x: 9, y: 1 }, {x: 9, y: 2}, {x: 10, y: 2},{x: 10, y: 1}]
                        }
                    ]
                },

            ]
        },
        
        
        {
            id: "UIRoot",
            scripts: [
                { scriptName: "Transform", x: 0, y: 0, rotation: 0 }
            ],
            children: [
                {
                    id: "staticWords",
                    scripts: [
                        { scriptName: "Transform", x: 0, y: 0, rotation: 0 },
                        { scriptName: "TextRenderer", text: "金币：", fontSize: 28 },
                    ],
                    
                },
                {
                    id: "money",
                    scripts: [
                        { scriptName: "Transform", x: 80, y: 0, rotation: 0 },
                        { scriptName: "TextRenderer", text: " ", fontSize: 28 },
                        { scriptName: "TopUIBehaviour" }
                    ],
                }
            ]
        },
    ]
}

const content = JSON.stringify(a, null, '\t');
const fs = require('fs');
fs.writeFileSync('game.scene.json', content, 'utf-8');